//
//  Home_headerTableViewCell.m
//  sellHouse
//
//  Created by 李 佳伟 on 2018/11/23.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "Home_headerTableViewCell.h"
#import "JTCSM.h"

@interface Home_headerTableViewCell ()

@end

@implementation Home_headerTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
    
        
        
        NSString *numberstring = @"12501 房主已提交卖房申请";
        self.numberLabel = [UILabel initWithFrame:CGRectMake(Kspace, KVIEW_Y(self.headerImagev)+3, KSCREENWidth-2*Kspace, 50) text:numberstring font:21 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(15, 166, 231, 1) backgroundColor:nil];
        [self.contentView addSubview:self.numberLabel];
        [df fuwenbenLabel:self.numberLabel FontNumber:[UIFont systemFontOfSize:13] AndRange:NSMakeRange(numberstring.length-9, 9) AndColor:RGBACOLOR(153, 153, 153, 1)];
        
        
        CGFloat viewheight = 50;
        UIView *textfieldView = [[UIView alloc]initWithFrame:CGRectMake(Kspace, KVIEW_Y(self.headerImagev)+53, KSCREENWidth-2*Kspace, viewheight)];
        [df layerWithView:textfieldView radius:0 width:1 color:RGBACOLOR(241, 241, 241, 1)];
        [self.contentView addSubview:textfieldView];
        CGFloat viewWidth  = textfieldView.frame.size.width;
        CGFloat labelHeight = 12;
        UIImageView *tagimagev = [[UIImageView alloc]initWithFrame:CGRectMake(viewWidth-12-labelHeight, (viewheight-labelHeight)/2, labelHeight, labelHeight)];
        tagimagev.image = [UIImage imageNamed:@"yinsi.jpg"];
        [textfieldView addSubview:tagimagev];
        
        NSString *tagText = @"隐私保护";
        CGRect rect = [df labelHeightWithContent:tagText height:labelHeight font:labelHeight];
        UILabel *tagLabel = [UILabel initWithFrame:CGRectMake(viewWidth-12-labelHeight-6-rect.size.width, (viewheight-labelHeight)/2, rect.size.width, labelHeight) text:tagText font:labelHeight textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(153, 153, 153, 1) backgroundColor:nil];
        [textfieldView addSubview:tagLabel];
        
        self.textfield = [UITextField initWithframe:CGRectMake(Kspace, 0, 200, viewheight) backgrandColor:nil placeholder:@"请输入手机号" textAlignment:NSTextAlignmentLeft font:13 texcolor:RGBACOLOR(153, 153, 153, 1)];
        [textfieldView addSubview:self.textfield];
        
        self.sellHouseLabel = [UILabel initWithFrame:CGRectMake(Kspace, KVIEW_Y(textfieldView)+13, KSCREENWidth-2*Kspace, viewheight) text:@"极速卖房" font:14 textAlignment:NSTextAlignmentCenter texcolor:[UIColor whiteColor] backgroundColor:RGBACOLOR(15, 166, 231, 1)];
        [df layerWithView:self.sellHouseLabel radius:4 width:0 color:nil];
        [self.contentView addSubview:self.sellHouseLabel];
        CGFloat changespace = 20;
        CGFloat theLabelWidth = (self.sellHouseLabel.frame.size.width-changespace)/2;
        
        self.phone_sellLabel = [UILabel initWithFrame:CGRectMake(Kspace, KVIEW_Y(self.sellHouseLabel)+13, theLabelWidth, viewheight) text:@"电话卖房" font:14 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(126, 131, 137, 1) backgroundColor:RGBACOLOR(246, 247, 251, 1)];
        [df layerWithView:self.phone_sellLabel radius:4 width:0.5 color:RGBACOLOR(236, 237, 241, 1)];
        [self.contentView addSubview:self.phone_sellLabel];
        
        self.house_priceLabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(self.phone_sellLabel)+changespace, KVIEW_Y(self.sellHouseLabel)+13, theLabelWidth, viewheight) text:@"房屋估价" font:14 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(126, 131, 137, 1) backgroundColor:RGBACOLOR(246, 247, 251, 1)];
        [df layerWithView:self.house_priceLabel radius:4 width:0.5 color:RGBACOLOR(236, 237, 241, 1)];
        [self.contentView addSubview:self.house_priceLabel];
        
      UIView *lineviw = [df lineViewWithHeightofTop:KVIEW_Y(self.house_priceLabel)+23 superView:self.contentView lineHeight:10 space:0];
        
//        UILabel *titleLabel = [UILabel initWithFrame:CGRectMake(Kspace, KVIEW_Y(lineviw), KSCREENWidth-2*Kspace, 48) text:@"卖房流程" font:17 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
//        [self.contentView addSubview:titleLabel];
//        [df lineViewWithHeightofTop:KVIEW_Y(titleLabel) superView:self.contentView lineHeight:1 space:Kspace];
//       
//        
//        CGFloat changewidth = 50;
//        CGFloat numberspace = (KSCREENWidth-changewidth*3)/4;
//        
//        for (int i = 0; i<3; i++) {
//            UILabel *label = [UILabel initWithFrame:CGRectMake(numberspace+(changewidth+numberspace)*i, KVIEW_Y(titleLabel)+20, changewidth, changewidth) text:[NSString stringWithFormat:@"%d",i+1] font:22 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:RGBACOLOR(241, 241, 241, 1)];
//            label.tag= 1000+i;
//            [df layerWithView:label radius:changewidth/2 width:0.5 color:RGBACOLOR(231, 231, 231, 1)];
//            [self.contentView addSubview:label];
//        }
//        
//        CGFloat zheimagesize = 30;
//        
//        UIImageView *oneImagev = [[UIImageView alloc]initWithFrame:CGRectMake(numberspace+changewidth+(numberspace-zheimagesize)/2, KVIEW_Y(titleLabel)+20+(changewidth-zheimagesize)/2, zheimagesize, zheimagesize)];
//        oneImagev.image = [UIImage imageNamed:@"JIANTOU.png"];
//        [self.contentView addSubview:oneImagev];
//        
//        UIImageView *twoimagev = [[UIImageView alloc]initWithFrame:CGRectMake(numberspace*2+(numberspace-zheimagesize)/2+changewidth*2, KVIEW_Y(titleLabel)+20+(changewidth-zheimagesize)/2, zheimagesize, zheimagesize)];
//        twoimagev.image = [UIImage imageNamed:@"JIANTOU.png"];
//        [self.contentView addSubview:twoimagev];
//        
//        CGRect zherect = [df labelHeightWithContent:@"平均13天成交" width:1000 font:12];
//        
//        CGFloat labelspace = (KSCREENWidth-zherect.size.width*3)/4;
//        
//        NSArray *arr = @[@"在线提交委托",@"全城中介售卖",@"买家购房签约"];
//        NSArray *arr1 = @[@"免费上门评估",@"买家咨询看房",@"平均13天成交"];
//        UILabel *zhel = [self.contentView viewWithTag:1000];
//        for (int i = 0; i<arr.count; i++) {
//            UILabel *label = [UILabel initWithFrame:CGRectMake(labelspace+(zherect.size.width+labelspace)*i, KVIEW_Y(zhel)+12, zherect.size.width, zherect.size.height) text:arr[i] font:12 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(153, 153, 153, 1) backgroundColor:nil];
//            [self.contentView addSubview:label];
//            
//            UILabel *label1 = [UILabel initWithFrame:CGRectMake(labelspace+(zherect.size.width+labelspace)*i, KVIEW_Y(label)+8, zherect.size.width, zherect.size.height) text:arr1[i] font:12 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(153, 153, 153, 1) backgroundColor:nil];
//            [self.contentView addSubview:label1];
//            label1.tag = 2000+i;
//        }
//        
//        UILabel *label1 = [self.contentView viewWithTag:2000];
//        UIView *twolineviw = [df lineViewWithHeightofTop:KVIEW_Y(label1)+23 superView:self.contentView lineHeight:10 space:0];
//        UILabel *secondtitleLabel = [UILabel initWithFrame:CGRectMake(Kspace, KVIEW_Y(twolineviw), KSCREENWidth-2*Kspace, 48) text:@"卖房优势" font:17 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
//        [self.contentView addSubview:secondtitleLabel];
//        [df lineViewWithHeightofTop:KVIEW_Y(secondtitleLabel) superView:self.contentView lineHeight:1 space:Kspace];
//        
//        CGFloat twochangespace = 8;
//        CGFloat youshiviewwidth = (KSCREENWidth-2*Kspace-twochangespace)/2;
//        CGFloat youshiviewHeihgt = youshiviewwidth/82*31;
//        CGFloat labeltitleHeight = 14;
//        CGFloat labelcontentHeight = 12;
//        CGFloat labelchangspace = 7;
//        CGFloat labeltop = (youshiviewHeihgt-labeltitleHeight-labelcontentHeight-labelchangspace)/2;
//        CGFloat labelspaceleft = 10;
//        NSArray *titArray = @[@"最快售出",@"全城中介",@"全城经纪人",@"储备买家"];
//        NSArray *conArray = @[@"2小时",@"1100家",@"1万+",@"6万+"];
//        for (int i = 0 ; i<4; i++) {
//            UIImageView *view = [[UIImageView alloc]initWithFrame:CGRectMake(Kspace +(youshiviewwidth+twochangespace)*(i%2), KVIEW_Y(secondtitleLabel)+22+(youshiviewHeihgt+twochangespace)*(i/2), youshiviewwidth, youshiviewHeihgt)];
//            [df layerWithView:view radius:0 width:1 color:RGBACOLOR(241, 241, 241, 1)];
//            [self.contentView addSubview:view];
//            view.image = [UIImage imageNamed:[NSString stringWithFormat:@"youshi%d.jpeg",i]];
//            view.tag = 4000+i;
//            
//            
//            UILabel *titlel = [UILabel initWithFrame:CGRectMake(labelspaceleft, labeltop, youshiviewwidth-labelspaceleft, labeltitleHeight) text:titArray[i] font:14 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(102, 102, 102, 1) backgroundColor:nil];
//            [view addSubview:titlel];
//            UILabel *contentl = [UILabel initWithFrame:CGRectMake(labelspaceleft, KVIEW_Y(titlel)+labelchangspace, youshiviewwidth-labelspaceleft, labelcontentHeight) text:conArray[i] font:12 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(102, 102, 102, 1) backgroundColor:nil];
//            [view addSubview:contentl];
//            [contentl setFont:[UIFont fontWithName:@"Helvetica-Bold" size:12]];
//            
//        }
//        UIView *tagview = [self.contentView viewWithTag:4003];
//       UIView *threeLine= [df lineViewWithHeightofTop:KVIEW_Y(tagview)+23 superView:self.contentView lineHeight:10 space:0];
//        
//        UILabel *thirdtitleLabel = [UILabel initWithFrame:CGRectMake(Kspace, KVIEW_Y(threeLine), KSCREENWidth-2*Kspace, 48) text:@"秒卖房问答" font:17 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
//        [self.contentView addSubview:thirdtitleLabel];
//        [df lineViewWithHeightofTop:KVIEW_Y(thirdtitleLabel) superView:self.contentView lineHeight:1 space:Kspace];
//        
//        [df lineViewWithHeightofTop:KVIEW_Y(thirdtitleLabel)+10 superView:self.contentView lineHeight:10 space:0].backgroundColor=[UIColor whiteColor];
//        
        
        
    }
    
    return self;
}

- (void)setValueWithPersonNumber:(NSString *)number{
    NSString *numberstring = [NSString stringWithFormat:@"%@ 房主已提交卖房申请",number];
    self.numberLabel.text = numberstring;
    [df fuwenbenLabel:self.numberLabel FontNumber:[UIFont systemFontOfSize:13] AndRange:NSMakeRange(numberstring.length-9, 9) AndColor:RGBACOLOR(153, 153, 153, 1)];
}

@end
